package model.towers;

import java.util.concurrent.CopyOnWriteArrayList;

import model.bullets.IBullet;
import model.enemies.IEnemy;
import android.graphics.Bitmap;
import android.graphics.Canvas;

/**
 * Interface representing the towers in the game.
 * 
 * @author EvilTeam
 *
 */
public interface ITower extends Comparable<ITower>{

	/**
	 * Draws the towers.
	 * @param canvas
	 */
	public void draw(Canvas canvas);

	/**
	 * Draws the range of the tower.
	 * @param canvas
	 */
	public void drawRange(Canvas canvas);

	/**
	 * 
	 * @param x
	 * @param y
	 * @return true if the tower has beeen touched.
	 */
	public boolean checkIfTheTowerIsTouched(float x, float y);

	/**
	 * Setting tower thread for shooting.
	 * @param towerThread
	 */
	public void setStartShootingThread(StartShootingThread towerThread);

	/**
	 * 
	 * @return the towers shooting thread.
	 */
	public StartShootingThread getStartShootingThread();

	/**
	 * 
	 * @return the current enemies.
	 */
	public CopyOnWriteArrayList<IEnemy> getEnemy();

	/**
	 * Setting new targets.
	 * @param enemies
	 */
	public void setEnemy(CopyOnWriteArrayList<IEnemy> enemies);

	/**
	 * 
	 * @param enemy
	 * @return true if an enemy is in range.
	 */
	public boolean inRange(IEnemy enemy);

	/**
	 * 
	 * @return the tower damage.
	 */
	public int getDamage();

	/**
	 * Setting tower damage.
	 * @param damage
	 */
	public void setDamage(int damage);

	/**
	 * Updating the tower rotate direction.
	 */
	public void update();

	/**
	 * 
	 * @return the x axis point of the tower.
	 */
	public float getxAxisPoint();

	/**
	 * 
	 * @return the y axis point of the tower.
	 */
	public float getyAxisPoint();

	/**
	 * 
	 * @return true if the tower has been sold.
	 */
	public boolean isSold();

	/**
	 * Setting the sold property of the tower.
	 * @param isSold
	 */
	public void setSold(boolean isSold);

	/**
	 * Current frame of the image for tower rotate direction.
	 * @param currentFrame
	 */
	public void setCurrentFrame(int currentFrame);

	/**
	 * Setting rotate direction for the tower.
	 * @param currentDirection
	 */
	public void setCurrentDirection(int currentDirection);

	/**
	 * 
	 * @return a bitmap object with scaled sell icon.
	 */
	public Bitmap getScaledSellIcon();

	/**
	 * Setting scaled image for sell icon.
	 * @param scaledSellIcon
	 */
	public void setScaledSellIcon(Bitmap scaledSellIcon);

	/**
	 * 
	 * @return a bitmap object with scaled upgrade icon.
	 */
	public Bitmap getScaledUpgradeIcon();

	/**
	 * Setting scaled image for upgrade icon.
	 * @param scaledSellIcon
	 */
	public void setScaledUpgradeIcon(Bitmap scaledUpgradeIcon);

	/**
	 * 
	 * @return the tower price.
	 */
	public int getPrice();

	/**
	 * 
	 * @return the tower range.
	 */
	public float getRange();

	/**
	 * Setting tower range.
	 * @param range
	 */
	public void setRange(float range);

	/**
	 * 
	 * @return the number of allowed upgrades.
	 */
	public int getNumberOfAllowedUpgrades();

	/**
	 * Setting the number of allowed upgrades.
	 * @param numberOfAllowedUpgrades
	 */
	public void setNumberOfAllowedUpgrades(int numberOfAllowedUpgrades);

	/**
	 * 
	 * @return towers shooting speed.
	 */
	public int getShootingSpeed();

	/**
	 * Setting towers shooting speed.
	 * @param shootingSpeed
	 */
	public void setShootingSpeed(int shootingSpeed);

	/**
	 * 
	 * @return collection with the towers ammo.
	 */
	public CopyOnWriteArrayList<IBullet> getBullets();

	/**
	 * Adding new bullet in the tower's bullet collection.
	 * @param bullet
	 */
	public void addBullet(IBullet bullet);
	
	/**
	 * 
	 * @return true if the tower is touched.
	 */
	public boolean isTouched();
}
